﻿using UnityEngine;
using System.Collections;

public class Basket {

	GameObject basket;

	public void Load()
	{
		basket = Graphic.Draw ("Basket", new Vector2 (100, 81), "IMG/Ro");
		basket.transform.position = new Vector3 (0, -280, 3);
		BoxCollider A = basket.AddComponent<BoxCollider> () as BoxCollider;
		A.size = new Vector2 (100,81);
		basket.tag = "ro";
		basket.AddComponent<MoveController>();
	}

	public void StartGame(){
		basket.transform.position = new Vector3 (0, -280, 3);
	}


	public void GetInput()
	{

			if (Input.GetKey(KeyCode.LeftArrow))
			{	
				if(basket.transform.position.x>-600)
					basket.transform.position -= new Vector3 (10, 0, 0);

			}
			if (Input.GetKey(KeyCode.RightArrow))
			{
				if(basket.transform.position.x<600)
					basket.transform.position += new Vector3 (10, 0, 0);
			}
	
//		if(Input.GetAxis("Mouse X")<0){
//			basket.transform.position -= new Vector3 (10, 0, 0);
//		}
//		if(Input.GetAxis("Mouse X")>0){
//			basket.transform.position += new Vector3 (10, 0, 0);
//		}
	}
}
